package com.xbao.dao;

import com.xbao.model.ClsNotify;
import com.xbao.model.ClsNotifyExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

@Mapper
public interface ClsNotifyMapper {
    @SelectProvider(type=ClsNotifySqlProvider.class, method="countByExample")
    int countByExample(ClsNotifyExample example);

    @DeleteProvider(type=ClsNotifySqlProvider.class, method="deleteByExample")
    int deleteByExample(ClsNotifyExample example);

    @Delete({
        "delete from cls_notify",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into cls_notify (cid, wxmsg, ",
        "updatetime, createtime)",
        "values (#{cid,jdbcType=BIGINT}, #{wxmsg,jdbcType=INTEGER}, ",
        "#{updatetime,jdbcType=BIGINT}, #{createtime,jdbcType=BIGINT})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Long.class)
    int insert(ClsNotify record);

    @InsertProvider(type=ClsNotifySqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Long.class)
    int insertSelective(ClsNotify record);

    @SelectProvider(type=ClsNotifySqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="cid", property="cid", jdbcType=JdbcType.BIGINT),
        @Result(column="wxmsg", property="wxmsg", jdbcType=JdbcType.INTEGER),
        @Result(column="updatetime", property="updatetime", jdbcType=JdbcType.BIGINT),
        @Result(column="createtime", property="createtime", jdbcType=JdbcType.BIGINT)
    })
    List<ClsNotify> selectByExample(ClsNotifyExample example);

    @Select({
        "select",
        "id, cid, wxmsg, updatetime, createtime",
        "from cls_notify",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="cid", property="cid", jdbcType=JdbcType.BIGINT),
        @Result(column="wxmsg", property="wxmsg", jdbcType=JdbcType.INTEGER),
        @Result(column="updatetime", property="updatetime", jdbcType=JdbcType.BIGINT),
        @Result(column="createtime", property="createtime", jdbcType=JdbcType.BIGINT)
    })
    ClsNotify selectByPrimaryKey(Long id);

    @UpdateProvider(type=ClsNotifySqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") ClsNotify record, @Param("example") ClsNotifyExample example);

    @UpdateProvider(type=ClsNotifySqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") ClsNotify record, @Param("example") ClsNotifyExample example);

    @UpdateProvider(type=ClsNotifySqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(ClsNotify record);

    @Update({
        "update cls_notify",
        "set cid = #{cid,jdbcType=BIGINT},",
          "wxmsg = #{wxmsg,jdbcType=INTEGER},",
          "updatetime = #{updatetime,jdbcType=BIGINT},",
          "createtime = #{createtime,jdbcType=BIGINT}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(ClsNotify record);
}